package com.ez.supervise.dao.impl;

import java.util.List;

import com.ez.supervise.core.Page;
import com.ez.supervise.dao.OrgCheckDao;
import com.ez.supervise.dao.base.BaseDaoImpl;
import com.ez.supervise.model.biz.OrgCheck;

public class OrgCheckDaoImpl extends BaseDaoImpl implements OrgCheckDao {

    public void insert(Object orgCheck) {
	sqlMapClientTemplate.insert("biz.insertOrgCheck", orgCheck);
    }

    public Object get(Long id) {
	return (OrgCheck) sqlMapClientTemplate.queryForObject("biz.getOrgCheckById", id);
    }

    public void update(Object org) {
	sqlMapClientTemplate.update("biz.updateOrgCheck", org);
    }

    public void delete(Long id) {
	sqlMapClientTemplate.update("biz.deleteOrgCheck", id);
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.dao.OrgCheckDao#findByCount(com.ez.supervise.core.Page)
     */
    public int findOrgCheckByCount(Page page) {
	return (Integer) getSqlMapClientTemplate().queryForObject("biz.findOrgCheckByCount", page.getConditions());
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.dao.OrgCheckDao#findByPage(com.ez.supervise.core.Page)
     */
    public List findOrgCheckByPage(Page page) {
	return getSqlMapClientTemplate().queryForList("biz.findOrgCheckByPage", page.getConditions());
    }

    /*
     * (non-Javadoc)
     * 
     * @see com.ez.supervise.dao.OrgCheckDao#findAll()
     */
    public List findAll() {
	return getSqlMapClientTemplate().queryForList("biz.findAllOrgCheck");
    }

    /* (non-Javadoc)
     * @see com.ez.supervise.dao.OrgCheckDao#findGoalByType(java.lang.String)
     */
    public List findGoalByType(String type) {
	return getSqlMapClientTemplate().queryForList("biz.findGoalByType",type);
    }

    public int findOrgCheckSettingByCount(Page page) {
	return (Integer) getSqlMapClientTemplate().queryForObject("biz.findOrgCheckSettingByCount", page.getConditions());
    }

    public List findOrgCheckSettingByPage(Page page) {
	return getSqlMapClientTemplate().queryForList("biz.findOrgCheckSettingByPage", page.getConditions());
    }

    public int countExisOrgCheck(OrgCheck orgCheck) {
	return (Integer) getSqlMapClientTemplate().queryForObject("biz.countExisOrgCheck", orgCheck);
    }

    public void deleteOrgCheckSetting(Long id) {
	sqlMapClientTemplate.update("biz.deleteOrgCheckSetting", id);
    }

    public int findOrgCheckSelfByCount(Page page) {
	return (Integer) getSqlMapClientTemplate().queryForObject("biz.findOrgCheckSelfByCount", page.getConditions());
    }

    public List findOrgCheckSelfByPage(Page page) {
	return getSqlMapClientTemplate().queryForList("biz.findOrgCheckSelfByPage", page.getConditions());
    }

    public int findOrgCheckAuditByCount(Page page) {
	return (Integer) getSqlMapClientTemplate().queryForObject("biz.findOrgCheckAuditByCount", page.getConditions());
    }

    public List findOrgCheckAuditByPage(Page page) {
	return getSqlMapClientTemplate().queryForList("biz.findOrgCheckAuditByPage", page.getConditions());
    }

}
